package top.canyue.eca_manager.bean;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import org.springframework.data.annotation.Id;

import java.sql.Timestamp;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Todo {
    @Id
    private String id;
    @NonNull
    private String userId;
    @NonNull
    private String event;
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Timestamp endDate;
    @NonNull
    private boolean isDelete;
    private Timestamp createTime;
    private Timestamp updateTime;

    @Override
    public String toString() {
        return "{" +
                "'id':'" + id + '\'' +
                ", 'userId':'" + userId + '\'' +
                ", 'event':'" + event + '\'' +
                ", 'endDate':'" + endDate + "'" +
                ", 'isDelete':" + isDelete +
                ", 'createTime':'" + createTime + "'" +
                ", 'updateTime':'" + updateTime + "'" +
                '}';
    }
}
